import requests

cookies = {
    'Hm_lvt_975400bd703f587eef8de1efe396089d': '1733989140',
    'HMACCOUNT': 'D628B1163604AA31',
    'UM_distinctid': '193b9ce84fe1001-08a0b1831e28f1-26011851-1fa400-193b9ce84ff9d4',
    'uu': '2941e65b-fac7-4099-9747-3aa633fe5dbf',
    'source': '',
    'invitation': '',
    'Hm_lpvt_975400bd703f587eef8de1efe396089d': '1733990637',
    'CNZZDATA1278923901': '464977529-1733989140-%7C1733990637',
}

headers = {
    'Accept': 'application/json, text/plain, */*',
    'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
    'CLIENT-IDENTIFIER': '2941e65b-fac7-4099-9747-3aa633fe5dbf',
    'Cache-Control': 'no-cache',
    'Connection': 'keep-alive',
    'Content-Type': 'application/json;charset=UTF-8',
    # 'Cookie': 'Hm_lvt_975400bd703f587eef8de1efe396089d=1733989140; HMACCOUNT=D628B1163604AA31; UM_distinctid=193b9ce84fe1001-08a0b1831e28f1-26011851-1fa400-193b9ce84ff9d4; uu=2941e65b-fac7-4099-9747-3aa633fe5dbf; source=; invitation=; Hm_lpvt_975400bd703f587eef8de1efe396089d=1733990637; CNZZDATA1278923901=464977529-1733989140-%7C1733990637',
    'Origin': 'https://www.kaoshibao.com',
    'Pragma': 'no-cache',
    'Referer': 'https://www.kaoshibao.com/online/paper/category/',
    'Sec-Fetch-Dest': 'empty', 
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'Sign': '114b34d0bc38e970d582093200e251c7',
    'TimeStamp': '1733990637427',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
    'platform': 'web',
    'sec-ch-ua': '"Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
}

json_data = {
    'cid': '',
    'keyword': '',
    'size': 15,
    'page': 2,
}

response = requests.post(
    'https://www.kaoshibao.com/api/paper/recommendByCategory',
    cookies=cookies,
    headers=headers,
    json=json_data,
)
print(response.json())

# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{"cid":"","keyword":"","size":15,"page":1}'
#response = requests.post('https://www.kaoshibao.com/api/paper/recommendByCategory', cookies=cookies, headers=headers, data=data)